import java.util.Arrays;

public class Test {


    public static void main(String[] args) {
        int []array={1,6,5,9,1,2,3,4};
        Arrays.sort(array);
        System.out.println(Arrays.toString(array));
    }

    public static void main5(String[] args) {
        int []array={1,2,3,4,5,6};
        System.out.println(Arrays.toString(array));
    }
    public static void main4(String[] args) {
        int []array={1,2,3,4,5,6};
    for(int x:array) {
        System.out.print(x+" ");
        }
    }

    public static void main3(String[] args) {
        int []array={1,2,3,4,5,6};
        for (int i = 0; i <array.length ; i++) {
            System.out.print(array[i]+" ");
        }
        System.out.println();
    }
    public static void main2(String[] args) {
        int[]array1={1,2,3,4,5};
        int[]array2=new int[]{1,2,3,4,5};
        int[]array3=new int[6];
    }
    public static void main1(String[] args) {
    //如果我我们班有5个同学，我该如何将同学的姓名保存下来

        int [] arr=new int[7];
        int []arr1;
        for (int i = 0; i <arr.length ; i++) {
            arr[i]=i;
        }
        arr[7]=8;
        System.out.println("-------");



//        String []array={"张三","李四","王五","小明","小朋"};
//        System.out.println(array[0]);
//        System.out.println(array[1]);
//        System.out.println(array[2]);
//        System.out.println(array[3]);
//        System.out.println(array[4]);




    }
}
